interface ApiResponse<T = unknown> {
  code: number
  data: T
  msg: string
}

export interface Responses {
  getAssignmentsByClassId: ApiResponse<{
    requirementType: string
    assignmentDate: string
    id: number
    createTime: string
    title: string
    totalBooks: number
    totalMembers: number
    completedCount: number
  }[]>
  createAssignment: ApiResponse<{
    id: number
    title: string
    assignmentDate: string
    requirementType: 'read'
    totalBooks: number
    completedCount: number
    totalMembers: number
    createTime: string
  }>
  getAssignmentInfoByAssignmentId: ApiResponse<{
    id: number
    title: string
    classId: number
    creatorId: number
    assignmentDate: string
    requirementType: string
    description: string
    totalBooks: number
    completedCount: number
    totalMembers: number
    books: {
      id: number
      title: string
      cover: string
      isCompleted: boolean
    }[]
    createTime: string
  }>
  getCompletedInfosByAssignmentId: ApiResponse<{
    userId: number
    nickname: string
    avatar: string | null
    completedBooks: number
    totalBooks: number
    progressPercentage: number
    lastSubmitTime: string | null
    remainingBooks: number
    isStarted: boolean
    status: string
  }[]>
  getIncompletedInfosByAssignmentId: ApiResponse<{
    userId: number
    nickname: string
    avatar: string
    completedBooks: number
    totalBooks: number
    status: string
  }[]>
  deleteAssignmentByAssignmentId: ApiResponse<string>
  editAssignmentByAssignmentId: ApiResponse<string>
  getSelectableBooks: ApiResponse<{
    id: number
    title: string
    cover: string
    language: 'zh' | 'en'
    bookSetId?: number
    bookSetTitle?: string
    bookSetCover?: string
    pages?: number
  }[]>
  getSelectableBookSets: ApiResponse<{
    id: number
    title: string
    description?: string
    cover: string
    language: 'zh' | 'en'
    bookCount: number
    difficultyLevel?: string
    ageRange?: string
  }[]>
  getBooksByBookSetId: ApiResponse<{
    id: number
    title: string
    cover: string
    language: 'zh' | 'en'
    bookSetId: number
    bookSetTitle: string
    bookSetCover: string
    pages: number
  }[]>
}
